import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    // 登录
    {
      path: '/',
      name: 'Login',
      component: () => import('@/components/Login'),
    },
    {
      path: '/register',
      name: 'Register',
      component: () => import('@/components/register'),
    },
    // 管理员用例
    {
      path: '/Admin',
      name: 'AdminLayout',
      component: () => import('@/layout/AdminLayout/AdminLayout'),
      children: [{
        path: '/Admin/AdminMainPage',
        name: 'AdminMainPage',
        component: () => import('@/layout/AdminLayout/AdminMainPage')
      }, {
        path: '/Admin/AdminIndex',
        name: 'AdminIndex',
        component: () => import('@/layout/AdminLayout/Views/AdminIndex')
      }, {
        path: '/Admin/DoctorManage',
        name: 'DoctorManage',
        component: () => import('@/layout/AdminLayout/Views/DoctorManage')
      }, {
        path: '/Admin/AuditManage',
        name: 'AuditManage',
        component: () => import('@/layout/AdminLayout/Views/AuditManage')
      }]
    },
    // 医生用例
    {
      path: '/Doctor',
      name: 'DoctorLayout',
      component: () => import('@/layout/DoctorLayout/DoctorLayout'),
      children: [{
        path: '/Doctor/DoctorMainPage',
        name: 'DoctorMainPage',
        component: () => import('@/layout/DoctorLayout/DoctorMainPage')
      }, {
        path: '/Doctor/DoctorIndex',
        name: 'DoctorIndex',
        component: () => import('@/layout/DoctorLayout/Views/DoctorIndex')
      }, {
        path: '/Doctor/Consultation',
        name: 'Consultation',
        component: () => import('@/layout/DoctorLayout/Views/Consultation')
      }]
    }
  ]
})
